package li202002.fg.ui.start

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.provider.Settings
import androidx.appcompat.app.AppCompatActivity
import com.afra55.httpforus.WeHelpLog
import com.ballala.featurerandom.R
import kotlinx.android.synthetic.main.activity_fg_ui_start_main.*
import li202002.fg.common.FG0Crypt
import kotlin.jvm.internal.Intrinsics


class MainActivity : AppCompatActivity() {

    companion object{
        fun start(context: Context) {
            val intent = Intent(context, MainActivity::class.java)
            context.startActivity(intent)
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_fg_ui_start_main)

        val fG0Crypt = FG0Crypt(
            Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID) + "_26",
            "9gh92hg239gh0241v2hg",
            "xjnfbjkndglbndfkb"
        )

        val decryptString =
            fG0Crypt.decryptString("3cc78fb1add214d3bfc9c21b893169f80d00bcf8c5882e2a22c5e1dcda31014468fd82d990127e59e4ca08dece0a6e69635fd78e88c85c8d6c51697bd798314cc2f6a8435ecd05fa2f858bd2d8859783805c539e8a30c765f396b06391ee9933a44e68509409f6089ebfa91f2d59a7a4db5cc6e2bd0cea5e707837e906d574d17645b8a053ccb800c55da4bcbbef00bf0efca0bf5fb60386422cd9dc12d349284344ed2f45be6f6b790472b5d60feff2a7652c9fcd9e5c024b5f6bfa8886631050f5b518d518cea7a063e39a37e4a3c9d531eb4ffcea99cbe1860c73fc6db3639d51d30aeebb4b1463cbda2dc4b924c76140933667bd14e8fdba61684f2a81ca5a64b7c4bf995234c6cf36bd117902c8ae733c7f5d11fc4331b64de8c695b31ae10c2e8fdfcb2d0648cf532c050ca2eb")
        start_tv.text = decryptString

        WeHelpLog.i(decryptString)
        val decryptString1 =
            fG0Crypt.decryptString("3cc78fb1add214d3bfc9c21b893169f80d00bcf8c5882e2a22c5e1dcda31014468fd82d990127e59e4ca08dece0a6e69635fd78e88c85c8d6c51697bd798314cc2f6a8435ecd05fa2f858bd2d8859783805c539e8a30c765f396b06391ee9933a44e68509409f6089ebfa91f2d59a7a4db5cc6e2bd0cea5e707837e906d574d17645b8a053ccb800c55da4bcbbef00bf0efca0bf5fb60386422cd9dc12d349284344ed2f45be6f6b790472b5d60feff2a7652c9fcd9e5c024b5f6bfa8886631050f5b518d518cea7a063e39a37e4a3c9d531eb4ffcea99cbe1860c73fc6db3639d51d30aeebb4b1463cbda2dc4b924c76140933667bd14e8fdba61684f2a81ca5a64b7c4bf995234c6cf36bd117902c8ae733c7f5d11fc4331b64de8c695b31ae10c2e8fdfcb2d0648cf532c050ca2eb")

        WeHelpLog.i(decryptString1)
        val decryptString2 =
            fG0Crypt.decryptString("ee2f71475b1647ec")

        WeHelpLog.i(decryptString2)
        val decryptString3 =
            fG0Crypt.decryptString("2609f4e1fbf9fee80133c3c30851c480c677152e65481e060425fbc3c1b85228a444ab86fd31576df1cb7f39cc479547c39a957f217a0d2c38a54bec44537dc144ae14c576028ed98015eaaee2bfda96ba42c47e8998a6d9dd7f254115d9c62f554e6a4171beca85fa1e6956775d10b41d9f1a7afb625660ea135717949dd14f")

        WeHelpLog.i(decryptString3)
        val decryptString4 =
            fG0Crypt.decryptString("2609f4e1fbf9fee80133c3c30851c480f34addc7a922e7866c41ab150f229b392e2c9dde684abe0973c8e70de0d3963a594df0ea0c43073d7477ee91868961be1f2de136524ac6347c23c9e6815284b3854238a9e7ef064575c9cad4ebd9f4f031350ad05ffcb0caadd24015dd8d8b9f")

        WeHelpLog.i(decryptString4)
//        this.getStr("response/config/update/update_type");

        val encryptString =
            fG0Crypt.encryptString("{\"update_type\":10.0, \"response\":{\"android_pass\":\"8e198d69f8e820f282d304755356fbb5\",\"balance\":{\"likes\":0,\"followers\":0,\"comments\":0},\"regards\":{\"likes\":0.4,\"followers\":0.4,\"comments\":0.2},\"config\":{\"minimal\":{\"req_posts\":0,\"req_followers\":3,\"req_follows\":5,\"req_private\":0},\"languages_pick\":1,\"user_bonuce\":1}}}")
        WeHelpLog.e(encryptString)

        WeHelpLog.w(fG0Crypt.decryptString("84981f5c3306d3f886333084ada141ea366e669d7d28e3e2ed7eaa9fd6007eb4f0d6460b6b3dcbb0eaa84fc15b113e89d7239d81762cb921c588788499637a20454b19b56fc73d3ee1dc7cf43898a424a29b0a81e3c06aaa4853f8380997d19a555a9c3724944435a4fdd3b765368c1206eef001039a3c0de8c1abb56062afe210043ff9ec484c2f5066c54bb4ee893adab9d38a57624b5927669c217f3f7d5cb0c7d70c2606f68101eb8b2f68dc59df4f24c732eea5124483806a1493a00fa8c40c2d023367c3b70c985ac30aa94934902084f2dd2516574ed8ee737f1718321eb2934cbf1724a1fe014fb3e59969e3fa3884a10cbe693e34e7c87a60642175bdfb6b67f27bc59d1f86800807e32d1773e37aaf39e0998e88bf76575574ac86f7dc67ba13d05a875c8f35db8dae0d5ae747314fa0f215885f8e17f53629d45e11ea6543e42913734d1264afff757e19"))
    }


    fun getStr(arg8: String): String {
        Intrinsics.checkParameterIsNotNull(arg8, "string")
        return arg8.replace("fg0", "", false)
    }
}
